#pragma once

#include "IXBaseObj.h"

const UINT_PTR  g_nInvalidTimerId = (UINT_PTR)-1;

/**
 *
 */
class ExportXSkinLib IXTimer
{
public:
    virtual ~IXTimer();

    virtual void STDMETHODCALLTYPE   OnTimer(UINT_PTR uTimerId, void* pData) = 0;
};

class ExportXSkinLib IXTimerMgr : public IXBaseObj
{
    DEF_INTERFACE(IXTimerMgr, _T("{EC3478E2-FFB9-4e6e-9CA3-225EB6F1AFA6}"));

public:
    virtual UINT_PTR STDMETHODCALLTYPE  SetTimer(IXTimer* pTimer, UINT uElapse, void* pData) = 0;
    virtual UINT_PTR STDMETHODCALLTYPE  SetAsyncTimer(IXTimer* pTimer, UINT uElapse, void* pData) = 0;

    virtual UINT_PTR STDMETHODCALLTYPE  ResetTimer(UINT_PTR uId, UINT uElapse) = 0;
    virtual void*    STDMETHODCALLTYPE  ResetTimer(UINT_PTR uId, void* pData) = 0;
    virtual IXTimer* STDMETHODCALLTYPE  ResetTimer(UINT_PTR uId, IXTimer* pTimer) = 0;

    virtual BOOL     STDMETHODCALLTYPE  KillTimer(UINT_PTR uId) = 0;
    virtual BOOL     STDMETHODCALLTYPE  KillTimer(IXTimer* pTimer) = 0;
};
